package com.techwells.learningkites.model;

import java.util.ArrayList;
import java.util.List;

import com.techwells.learningkites.base.KitesViewModel;
import com.techwells.learningkites.networkservice.KitesServiceMediator;
import com.techwells.learningkites.networkservice.model.Course;
import com.techwells.learningkites.networkservice.model.Page;
import com.techwells.learningkites.networkservice.model.UserProfile;
import com.techwells.learningkites.networkservice.model.VideoCategory;
import com.techwells.learningkites.networkservice.model.CourseCategory;
import com.techwells.taco.tasktool.TaskToken;

public class MainPageViewModel extends KitesViewModel {
	
	public List<VideoCategory> videoCategoryList;
	public List<CourseCategory> courseCategoriesList;
	public Page page;
	public List<Course> courseList;
	public int returnCode;
	public UserProfile userProfile;

	@Override
	public void paddingResult(TaskToken token) {
		// TODO Auto-generated method stub
		super.paddingResult(token);
		
		String method = token.method;
		if (method.equals(KitesServiceMediator.SERVICE_GET_VIDEOS_CATEGORIES)) {
			videoCategoryList = (List<VideoCategory>) response.getResponse();
		}else if (method.equals(KitesServiceMediator.SERVICE_GET_COURSES_CATEGORIES)) {
			courseCategoriesList = (List<CourseCategory>) response.getResponse();
		}else if (method.equals(KitesServiceMediator.SERVICE_GET_COURSES)) {
			courseList = (List<Course>) response.getResponse();
		}else if (method.equals(KitesServiceMediator.SERVICE_GET_CATEGORY_VIDEOS)) {
			page = (Page) response.getResponse();
		}else if (method.equals(KitesServiceMediator.SERVICE_DO_LOGOUT)) {
			returnCode = response.getReturnCode();
		}else if (method.equals(KitesServiceMediator.SERVICE_GET_PROFILE)) {
			userProfile = (UserProfile) response.getResponse();
		}
		
	}
	
	
	
	
	

}
